﻿<div class="posts index">
	<h2>DANH SÁCH TIN ĐĂNG</h2>
	<table>
	<tr>
			<th width="5%">STT</th>
			<th width="50%">Tiêu đề</th>
			<th width="25%">Ngày đăng</th>
			<th width="15%">Thành phố</th>
			<th class="actions" width="15%"><?php __('Actions');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($posts as $post):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $post['Post']['tieude']; ?>&nbsp;</td>
		<td><?php echo $post['Post']['created']; ?>&nbsp;</td>
		<td><?php echo $post['Post']['tinhthanh']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('sửa', true), array('action' => 'edit', $post['Post']['id'])); ?>
			<?php echo $this->Html->link(__('xóa', true), array('action' => 'delete', $post['Post']['id']), null, sprintf(__('Bạn chắc chắn xóa tin:  %s?', true), $post['Post']['tieude'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>